Skip to content

fix(share): sync referenced project files separately from sharing in Studio - #8221

Open
terencecho wants to merge 12 commits into
mainfrom
codex/desktop-source-exclusions
Open

terencecho wants to merge 12 commits into
mainfrom
codex/desktop-source-exclusions

Conversation

@terencecho

@terencecho terencecho commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

What changed

Studio shares the rendered video and attaches project files only when a previously published snapshot in the selected workspace matches the current project and render. Sync project files uploads eligible source files separately. Creating or updating a link cannot start, resume, or cancel a source upload. With no matching snapshot, sharing creates a video-only version.

Studio shows the referenced hidden paths before sync. A project stylesheet can include a font from a hidden folder, while an unused font beside it stays local. Private paths and project exclusions take precedence. Terminal users can still explicitly upload editable files with --include-source.

How it works

  • Follow local references in markup, stylesheets, scripts, and nested compositions without executing project code. Capture the exact bytes selected by the manifest.
  • Require the disclosed hidden paths to agree with the captured paths before uploading. A lost upload receipt can be reconciled when those paths and bytes still match.
  • Revalidate snapshot ownership, workspace, published manifest, and render identity before attaching it. Syncing files by itself does not create a review or change its audience.
  • Readers must support the optional per-file marker before clients begin writing it. Publish compatible parser and share packages together.

Verification

The fixtures cover source selection, uploaded bytes, excluded paths, interrupted uploads, stored manifests, snapshot reuse, and edits after sync. Each of six independently removed validation guards fails a regression test.

The Studio tests cover the separate sync action, ordinary Share and Update, and a video share when file status is unavailable. A browser fixture verified the rendered popover and the separate sync and update requests.

Builds on the portable private-path policy merged in #8804.

fails without the fix: disabling reference discovery drops a required font from the upload fixture. Allowing ordinary Share to upload fresh source fails the read-only reuse fixture.

Before

Studio with the editable project files checkbox

After

Studio sharing panel with a separate Sync project files action

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 273 (base branch 271), smooth 57 of those

The gate passes.
Smoothness is reported in the artifact, not gated. A case fails only if it fails 2 of 3 runs.

Newly passing (2)

  • seqscaletwice-scale-px-r0-nested-z100
  • seqscaletwice-scale-px-r0-root-z100

Not banked yet, reported and not gated (bank a full-grid run's baseline.json) (2)

  • seqscaletwice-scale-px-r0-nested-z100
  • seqscaletwice-scale-px-r0-root-z100

Quarantined, measured but not gated (0)

@mintlify

mintlify Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
hyperframes 🟢 Ready View Preview Nov 25, 2026, 7:10 AM

💡 Tip: Enable Automations to automatically generate PRs for you.

@terencecho
terencecho changed the base branch from main to fix/share-source-private-paths November 24, 2026 19:08
@terencecho
terencecho marked this pull request as ready for review November 24, 2026 19:09
Base automatically changed from fix/share-source-private-paths to main November 24, 2026 23:17
@terencecho
terencecho force-pushed the codex/desktop-source-exclusions branch 2 times, most recently from 7cc740c to d53aca6 Compare November 24, 2026 23:38

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes at d53aca68 for one regression. Everything else checks out.

Blocking: files in hidden folders that a composition loads stop travelling, and nothing reports it.

  • The new unrecognized-hidden rule (path-policy.json) excludes any path with a hidden segment that portable-hidden-sources does not name.
  • On main these paths fell through to default-authored-file and travelled. Now capture leaves them out and the server rejects them:
    • assets/.hidden/logo.png
    • brand/.fonts/Inter.woff2
    • .fonts/Inter.woff2
    • assets/.media/a.png
  • Studio still serves these to the composition, because isStudioPrivatePath lets loaded asset types through hidden folders. So the project renders for the person sharing it. The person who opens the editable source gets it without that image, font or clip, and no capture problem is shown.
  • Either of these would close it:
    • Give portable-hidden-sources the same loaded-asset-type exception Studio uses, so what is shared matches what is served.
    • Or, if leaving them out is intended, report such a file as a capture problem instead of omitting it silently, and add a sentence to share-source.mdx.
  • Either way, please add a vector for an asset inside a hidden subfolder.

Checked and fine:

  • Parser refactor: the behaviour is unchanged. I compared the bundled isStudioPrivatePath before and after over 60,516 generated paths and found 0 differences. They covered both slash styles, .., empty segments, NFKC and case folding, zero-width characters, trailing dots and spaces, : suffixes, and .config/ghost vs .config/gh.
  • Private names: isPrivateSourcePath gives the same client answer before and after for every name probed, so locally excluded files stay excluded. What's new is that the server refuses them too, under private-source and the widened credential-files.
  • Unchanged handling:
    • Still excluded: .hyperframes/ state (root and nested), node_modules, root renders/, .git and .env*.
    • Still travelling: root .media/, ignore files, Studio edits, transcripts and podcast media.
  • Saved uploads holding a newly refused path: recoverSourceUpload drops them and captures again, and nothing throws. Stored manifests still read.
  • One source for the private-name rule: the parity tests pin the private-source contract regex to the parser's portablePrivatePattern, and the CLI's received-env.mjs copy to the parser. The generated audio-carve bundle matches a fresh build.
  • New exports: isPrivateSourcePath, privateSourceSpelling and readSourceIgnore ship through the existing ./projectSnapshot.mjs export and are typed. No CLI command or flag changed, and share-source.mdx covers the policy.
  • Tests (Node 22):
    • share: 170/170
    • core safePath: 206 pass, 1 skipped
    • CLI private-path: 47/47
    • studio-server history.private: 2/2
  • Red-first: with the sources at the merge base and the new tests kept, editable source omits credential stores and unrecognized hidden files while completed media travels and a host can use the package snapshot entry point for private names and strict ignore rules fail, and so does sourceManifest.test.mjs.

Non-blocking:

  • .github/ now carries only agents.md, workflows/*.yml and instructions/*.md. So CODEOWNERS, dependabot.yml and ISSUE_TEMPLATE/* stay local, as do root dotfiles such as .prettierrc, .editorconfig and .nvmrc. That reads as intended, but the docs could list what travels.
  • credential-files now overlaps private-source and isn't covered by the parity test, so it is a second list that can drift.
  • Hidden folders that can never hold a file that travels (such as .venv) are still walked file by file.

Need ✓ (one capture rule on both sides) · Size: medium, mostly vectors · Reuse ✓ (shared parser expression, parity-tested) · Simpler ✓ · Structure ✓
Risk: medium. Shares can silently lose hidden-folder assets that compositions load. The parser and share packages must ship together, as the body says.

— Rames

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve at 5f76199d (merge of main at ab4d38d5 into 0b05c8ad; the PR's own changes are line-for-line the same as at 0b05c8ad). My earlier finding is fixed.

Earlier finding (hidden-folder assets dropped without notice): fixed.

  • Capture now lists each eligible asset in a hidden folder. The CLI and local Studio show these before an editable share, with nothing preselected. Only the paths the sender picks travel, and each manifest entry records include_hidden: true.
  • Unattended CLI runs with eligible paths and no --include-hidden-assets now stop with hidden_asset_confirmation_required and list the paths, so nothing is dropped quietly. share-source.mdx documents both flows.
  • The manifest vectors cover a hidden subfolder asset: opted in, consent absent, a malformed marker, and an ineligible selection.

Checked:

  • Eligibility probe (validatePath(p, "current", true)):
    • Eligible: .fonts/Inter.woff2 and brand/.fonts/Inter.woff2.
    • Refused by their earlier rules:
      • .ssh, .SSH, .aws, .kube, .gnupg, .docker and .config/gcloud
      • .env/ and .env.local/
      • .git, node_modules/.cache, .hyperframes/*, .vscode, .idea, .claude, .codex, .cursor
      • .next and .NEXT, and .cache
      • a dot-named file inside a hidden folder, and *.pem / *.key there
  • Selection integrity:
    • A selected path that is no longer eligible becomes a capture problem.
    • The prepare step re-checks with the same selection before export (stillMatches), and the render fingerprint counts every eligible hidden asset.
    • A Studio request with includedHiddenPaths is accepted only for share or update with includeSource.
  • Tests: share passes 171/171 on Node 22.

Non-blocking:

  • The picker can list tool folders such as .yarn/releases/*.cjs, .npm/…/*.js or .terraform/…/*.js. They are opt-in, so nothing travels unasked, but it adds noise. Listing only the hidden assets the composition references, or pre-excluding package-manager folders, would keep the list short.
  • Scripts that ran --include-source unattended now need --include-hidden-assets once a project has eligible hidden files. That is intended and documented, and worth a release-notes line.

Need ✓ · Size: medium (selection flow plus vectors) · Reuse ✓ (one eligibility predicate, shared by preview, capture and manifest) · Simpler ✓ · Structure ✓
Risk: medium. This is a new manifest field. Readers must upgrade before writers, and the body says to publish the parser and share packages together.

— Rames

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Request changes at 1b6fdb5c. This review covers only the new commit; the rest was reviewed at eecd6233.

Blocker: the gitignore option covers the disclosure list but not the upload.
readSourceIgnore(root, { syntax: "gitignore" }) reaches listReferencedHiddenSourceAssets only. captureProject (capture.mjs:311), which shareSources.prepare uses, still calls readSourceIgnore(root) with the strict syntax. A host that follows the new README paragraph gets one of two failures. I checked both against prepare at this head:

.hyperframesignore Host's list (gitignore matcher) prepare result
logo.png (valid in both syntaxes, different meaning) [] unavailable: source_hidden_assets_changed, every retry
/drafts/ + !keep.txt (gitignore-only syntax) ["scene/.brand/logo.png"] throws the "one * wildcard … Negation … not supported" error

The fixture has index.html referencing scene/.brand/logo.png, plus the file itself.

  • In the first row, strict logo.png matches only at the root, while gitignore logo.png matches at any depth. The two lists differ, so the digest check rejects the share. "Refresh and retry" can't fix it, because the host recomputes the same list.
  • In the second row, the strict reader rejects the file outright.

So the feature fails closed: nothing undisclosed uploads, but a gitignore-style project can't share at all. One fix: give captureProject (and the shareSources options) the same ignored matcher, or the same syntax choice, so the disclosure list and the upload are built from one rule set. A test should run prepare end to end with a gitignore file that uses ! and an unanchored name.

Checked and fine:

  • Mounted overrides: each host's data-variable-values resolves against the host page's <base>, with no root fallback. A private value (.docker/…), a remote URL, an ignored file and free text all stay out. The per-mount queue key keeps two hosts of the same child separate.
  • Literal FontFace sources resolve against the loading document, not the script's folder.
  • index.html must stay included under gitignore rules, and the file is still opened through the same no-follow, size-capped reader.
  • Both Dockerfiles copy packages/parsers/src/ for the prepare typecheck, and the CLI summary goes through terminalLines.
  • Package tests: 180 of 180 pass locally after building parsers and core.

Need ✅ · Size ✅ · Reuse ⚠️ (two ignore readers now disagree within one share) · Simpler ✅ · Structure ⚠️ (a matcher option that only one of the two walks honours)

Risk: medium. The failure is closed: nothing extra uploads. But a host that adopts the documented option can no longer share projects whose ignore file uses gitignore syntax.

— Rames

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve at 5b18c830. This clears my change request from 1b6fdb5c.

The ignore syntax now reaches every capture. shareSources({ ignoreSyntax }) passes it to captureProject in prepare, to the final stillMatches checks (through shareSourceFingerprint), and to filesForExport. listReferencedHiddenSourceAssets accepts the same option, so the disclosure list and the upload are built from one rule set. Leaving the option out keeps the strict syntax.

I re-ran my two failing cases through prepare at this head. The fixture is index.html referencing scene/.brand/logo.png:

  • logo.png: the list is [], prepare returns ready, and filesForExport returns the snapshot. Before, this was source_hidden_assets_changed.
  • /drafts/ plus !keep.txt: the list is ["scene/.brand/logo.png"], prepare returns ready, and filesForExport returns the snapshot. Before, this was the strict reader's error.

The new fixtures check the manifest and the uploaded bytes, !/.ssh/ still staying local, and a rules change between disclosure and prepare, including retry. All 183 package tests pass locally.

Note: projectFingerprint (the render fingerprint) still reads the ignore file leniently with the strict syntax. That can only make it see more files, never fewer, so it can't make a share lose a file.

Need ✅ · Size ✅ · Reuse ✅ · Simpler ✅ · Structure ✅

Risk: medium. As before, this adds a reference scanner on the editable-source path, and a missed reference leaves an asset out of the recipient's copy. The ignore-syntax option is opt-in, and every capture in a share now reads the same rules.

— Rames

miguel-heygen
miguel-heygen previously approved these changes Nov 25, 2026

@miguel-heygen miguel-heygen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at 5b18c83. This read is security-focused: it asks whether a credential or private file can reach an editable share, and whether every site applies the same policy. It adds to the two rounds of review already on this PR, which cover the hidden-asset regression and the gitignore-syntax reach, both now fixed and approved at this head.

Audited: parsers/src/privatePath.ts, share/src/sources/{pathPolicy,privateSource,capture,referencedFiles,manifest,upload}.mjs, share/src/shareSources.mjs, the path-policy.json rule changes, cli/src/server/shareRoutes.ts, cli/src/commands/share.ts, core/src/terminalText.ts.
Trusting: assetReferences.mjs and variableAssets.mjs (I read their integration with the reference walk, not every parser branch), the Studio UI (SourceShareActions.tsx, QuickShare.tsx), the Dockerfiles, and the 589-line manifest-vectors.json fixture.

What's good

  • The editable-source rule and the file-server rule are now one expression. portablePrivatePattern (privatePath.ts:76) is what isVcsOrSecretPath and isCredentialOrToolStatePath test, and sourceManifest.test.mjs:184 pins the contract's private-source regex to it byte for byte. The two can't drift.
  • A reference never grants file access. referencedPath (referencedFiles.mjs:22-36) resolves only to entries already in the policy-filtered inventory. It refuses other origins, schemes, protocol-relative forms and encoded separators, so a composition can pull in only a hidden asset the walk already found eligible. Project code never runs.
  • The checks fail closed.
    • A scan problem makes listReferencedHiddenSourceAssets throw, and captureProject returns problems (capture.mjs:173, :326).
    • A hidden file whose bytes change between discovery and hashing is refused as changed (capture.mjs:333-334).
    • A shown summary that no longer matches what capture selects refuses the share with source_hidden_assets_changed (shareSources.mjs:150-158).
  • A hidden asset is checked under both spellings. validateHiddenSelection (pathPolicy.mjs:201-208) requires hidden-asset under the folded path and again under the parser spelling. The private-source and unrecognized-hidden rules are also matched against the parser spelling (:114-117).

Checked

  1. The privatePath.ts rewrite changes no answer. I ran main's isVcsOrSecretPath, isCredentialOrToolStatePath and isStudioPrivatePath side by side with this branch's, over every path of up to three segments built from 60 tricky segments: 230,763 paths. The segments included case variants, zero-width characters, fullwidth letters, trailing dots and spaces, the .config/gcloud|gh pair, every key and secret-store suffix, and the Studio folders. There were 0 differences. The file servers (core/safePath.ts, lint, the CLI's received-env) call these functions, so their behavior is unchanged.

  2. Hostile hidden paths. I classified 42 paths through classifyPath, isEligibleHiddenSourcePath and validatePath:

    • .SSH/, .ssh​/ (with a zero-width space), fullwidth .ssh/, nested x/.ssh/, .aws./ and .aws /, .config/GCLOUD/, .Claude/, .git/, .env.d/, .docker/, .kube/ and .gnupg/ all land on an exclusion rule and are not eligible.
    • So do .fonts/id_rsa.png and .fonts/a.key.
    • Only true asset paths in otherwise unlisted hidden folders are eligible, such as .fonts/a.woff2 and .config/other/a.css.
  3. The marker on the wire. parseManifest accepts include_hidden: true only on a path whose rule is hidden-asset. A credential path or agent state with the marker is refused as excluded_path. An ordinary or portable path with it is refused as invalid_schema. A non-true value is refused too.

  4. The local share route. GET /api/share/referenced-hidden-assets sits behind the same loopback, Sec-Fetch-Site, Origin and CSRF middleware as the other share routes (shareRoutes.ts:148-158). It returns only project-relative paths and their digest. The CLI prints paths through quotedFilePath and terminalLines, so a crafted file name can't inject terminal escapes.

  5. Every site that applies the policy (Rule 2):

    Site Check
    Capture walk (capture.mjs:48-57) classifyPath → isEligibleHiddenSourcePath for hidden assets, client_action otherwise, private folders pruned
    Reference selection (referencedFiles.mjs:219) unreferenced hidden files dropped
    Manifest parse, current and stored (manifest.mjs:49-60) marker shape, then validatePath(path, mode, marker)
    Upload recovery (upload.mjs:137) canUploadStoredPath: private paths are refused first
    Share prepare / stillMatches / filesForExport (shareSources.mjs) the same captureProject, with the same ignoreSyntax
    Stored snapshot read (wire.mjs:72) legacy rules: private-source, hidden-asset and unrecognized-hidden are (?!) there, so old digests stay readable, and they are used only for snapshot reuse
  6. Tests. The share suite passes 183/183 locally. Mutations:

    Mutation Result
    Unreferenced hidden files kept 8 tests fail
    Summary digest check removed 2 fail
    private-source not matched against the parser spelling 1 fails
    Non-true include_hidden accepted 1 fails
    validateHiddenSelection accepts any rule 0 fail
    Second, parser-spelling classification in validateHiddenSelection removed 0 fail
    Discovery-hash vs upload-hash mismatch ignored 0 fail
    A scan problem no longer refuses the listing 0 fail
    referencedPath origin check or encoded-separator check removed 0 fail

Important (not blocking)

  • Recovering an interrupted upload with a hidden asset always drops it. recoverSourceUpload checks each stored path with canUploadStoredPath(path) (upload.mjs:137), which calls validatePath(path) without the marker. A hidden-asset path therefore reads as excluded: canUploadStoredPath(".fonts/a.woff2") is false. Any interrupted share that carried a referenced font is cleared rather than resumed or reconciled. That fails closed, so nothing leaks. But it orphans the server-side upload, and the next Share starts over. Passing each file's include_hidden through to the check would let these resume.
  • Four of the new guards have no test that fails without them.
    • validateHiddenSelection's rule.id !== "hidden-asset" refusal and its second classification are the client-side mirror of the server rule. Check 3 shows they behave correctly today. A manifest vector with include_hidden: true on a credential path, and one on an ordinary path, would pin them.
    • Nothing tests the post-discovery change check (capture.mjs:333-334) or the scan-failure refusal (capture.mjs:173). One test that edits a referenced stylesheet between discovery and hashing would cover the first.

Nits

  • hidden-asset eligibility rests on the reference plus the extension. A hidden folder no rule names, such as .terraform/ or other .config/* subfolders, can contribute a .js or .css file if the composition loads it. That's consistent with the stated design (the page already loads it), and the private list covers the known credential stores. It's worth stating in share-source.mdx that a referenced hidden script travels.
  • *.key is now private for editable sources. The previous contract basis deliberately allowed it for Keynote decks. The description says so, but existing projects with a .key deck in their sources will see it stop travelling on their next share.

CI at 5b18c83: all 12 required checks are green. Of 96 check runs, 90 passed and 6 were skipped. mergeable_state is clean, and the branch merges cleanly with main.

Verdict: APPROVE
Reasoning: No credential, tool state or unreferenced hidden file can reach an editable share. The rewritten private-path rule gives the same answer as before on 230k paths, and every site applies one policy. Two things don't block and are worth a follow-up: the recovery path drops interrupted uploads that carry hidden assets, and four guards lack tests.

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE at e125d34a722856dc8ed3fb7040c29e5938c57098. This review covers the new commit; everything up to 5b18c830 was approved earlier.

Need ✅ · Size ✅ · Reuse ✅ (the replay check uses the same validatePath hidden-asset rule as capture) · Simpler ✅ · Structure ✅

Risk: low. A replay lists a hidden asset again only while it is still disclosed in the current share with the same bytes. Otherwise the saved intent is cleared and a new upload starts, as before.

What I checked

  • Replay rule. mayReplayManifest(saved, current) lets an unconfirmed Begin be sent again only when every saved entry passes canReplayUploadFile, which calls validatePath(path, "current", include_hidden === true). Each include_hidden entry must also appear, with the same sha256 and size, among the current capture's marked files. Those come from the same capture and disclosure that prepare checks. A removed or edited hidden asset, or a include_hidden flag on a file that isn't hidden, clears the intent.
  • No file bytes on replay. recoverSourceUpload replays begin only to learn the upload ID. A pending receipt is cancelled at once (cancelPending), and the changed project then uploads under its own manifest. A known upload ID still goes straight to status.
  • Fails without the fix: with the three source files from 5b18c830 restored, the new "a lost Begin for marked hidden assets reconciles publication…" test and the regular.png + include_hidden replay case fail (193 pass, 2 fail). At head, all 195 share tests pass locally after building parsers and core.
  • The docs and README describe the same rule, including the fallback where an earlier pending upload simply expires on the server.

— Rames

@terencecho terencecho changed the title fix(share): align editable sources with the sync credential policy fix(share): sync referenced project files separately from sharing in Studio Nov 25, 2026
@terencecho
terencecho changed the base branch from main to codex/portable-source-path-policy November 25, 2026 04:13

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: REQUEST_CHANGES

Re-review at cd079a4f7ed6497c985298b044338d3b88579daf, covering this PR's diff against its base branch codex/portable-source-path-policy (#8804 at 612b8f02). The split holds up. Ordinary Share and Update in Studio can no longer upload project files. One regression blocks: an ordinary Studio Share can now fail outright, and this push removed the only way to recover from that inside Studio.

Claims checked in code

  1. Share and Update can't upload. Holds. Studio builds the service with surface: "local_studio" (packages/cli/src/server/shareRoutes.ts:114). mutate passes reuseOnly = true into prepareSelectedSource (packages/cli/src/share/service.ts:333-340). In shareSources that sets readOnly (packages/share/src/shareSources.mjs:82). That flag skips recoverEarlierCapture (:214) and returns source_sync_required before store.write, api.create or uploadSource (:199). The route rejects includeSource on share and update with a 400, and it only accepts a digest on sync. I ran createShareService against every construction site: Studio routes and hyperframes share. Only two paths reach an upload: syncProjectFiles and the explicit CLI --include-source.
  2. "Matching snapshot" is well defined. A snapshot matches when the local binding is the same one: keyed by the project's real path, account and backend (store.mjs:13-24). The binding must be in the same workspace and its base.manifestSha256 must equal a fresh capture's sha. The server must also report that snapshot as published, with the same composition and digest (reuseSnapshot, :250-273). filesForExport re-checks the bytes and the binding (holdsSnapshot, :132-141). I tried these edge cases and none of them reused a snapshot:
    • an edit after sync
    • another workspace
    • an interrupted sync (inflight)
    • the binding moved to another workspace between prepare and export
    • a copied folder or a different account (store read fails closed, see the blocker below)
  3. Sync uses the #8804 policy. Holds. visit runs isPrivateSourcePath before any classification (capture.mjs:41). Hidden assets come only from the registry rule hidden-asset, which sits after the earlier private-path rules in path-policy.json. validateHiddenSelection re-classifies the parser spelling. There is no second ad-hoc filter. An unreferenced hidden file is pruned by retainReferencedFiles.

Blocker: a plain Studio Share fails with no in-app recovery

In read-only mode, prepareCliShareSource still turns any thrown error into ShareSourceError (packages/cli/src/share/sources.ts:61-68). Before this PR, a Studio Share without the checkbox never touched source state. Now every Share and Update in a workspace with file sharing reads the binding and calls the source limits API. This push also removed ShareSourceStatus and its "Retry with video only" button (QuickShareControls.tsx). Nothing in packages/studio/src handles source_unavailable any more.

Repro (scratch vitest at this head, real createProjectShareSourceStore):

  • Sync project a. Duplicate the folder to b, which copies .hyperframes/share-sync.*.json. Then share b from Studio. shareSources({reuseOnly: true}).prepare(b, …) throws Source binding belongs to another account, backend or project. Reset explicitly before sharing this copy.
  • The same throw happens on a when a different account is signed in.
  • A source limits call that fails, e.g. fetch failed, also throws.
  • shareError maps each of these to {"code":"source_unavailable","message":"… Retry sharing, or use --video-only to share just the video."}.

The Studio user hasn't asked for project files, can't pass --video-only, and has no button to fall back. GET /project-files hits the same throw and shows "Could not check synced project files. Reopen sharing to try again.", which can never succeed for a copied folder.

Suggested fix: when options.reuseOnly is set, return videoOnly(<reason>) from the catch in prepareCliShareSource instead of throwing. The person didn't ask for files, so a video-only version is the correct outcome. That matches the body's "with no matching snapshot, sharing creates a video-only version." Add a test that throws from prepare in read-only mode and expects video_only. Alternatively, restore a video-only retry in Studio for source_unavailable.

Non-blocking

  • When a synced base exists, every popover open runs sourceStatus, which hashes the whole project with a fresh hashMemo. A plain Share then captures again up to three times (prepare, stillMatches, filesForExport). That is fine for small projects, but worth a memo or an mtime shortcut for projects with large media.
  • /project-files and syncProjectFiles both call capture without ignoreSyntax, so they agree with each other. If Studio later opts into gitignore syntax, change both together.

Need · Size · Reuse · Simpler · Structure: Need is clear: share consent and file upload become separate actions. Own diff is 45 files, +2371/−329 (about 1190 source, 1112 tests and fixtures, 69 docs and lockfile). Reuse is good: one capture/policy path serves CLI, sync and reuse, and reuseOnly is a single flag through the existing adapter rather than a second code path. Nothing simpler stood out beyond the fallback above. Structure is fine: SourceShareActions is a clean seam.

Risk: medium. No path uploads without the explicit sync action. The regression is availability: ordinary Studio sharing now depends on local source state and the source API, and has no video-only escape.

Fails without the fix: the body has no fails without the fix: line naming a test. Red-first check: with the previous shareSources.mjs (e125d34a) swapped in, sourceAdapter.test.mjs "read-only sharing never starts or recovers an upload…" fails (expected source_sync_required). With the previous shareRoutes.ts, "only the sync action can upload project files" fails. Both pass at head.

Local runs at head: share node tests 87/87 (adapter, capture, manifest, reference graph); CLI share-scoped vitest 204/204 (17 files); Studio components/share 58/58.

CI: at review time most checks were still pending. regression is red only because its shards were cancelled (SHARDS_RESULT: cancelled). No test failure was reported.

Stack note: this PR targets codex/portable-source-path-policy, not main. #8804 has to land first, and then this one needs retargeting before its own merge.

— Rames

Base automatically changed from codex/portable-source-path-policy to main November 25, 2026 06:21
@terencecho
terencecho dismissed miguel-heygen’s stale review November 25, 2026 06:21

The base branch was changed.

This branch was successfully deployed

1 active deployment
staging - docs — 57ba4b4c Deployed Nov 25, 2026 by mintlify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants